<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Dynatree - Example</title>

  <script src="./js/jquery.min.js" type="text/javascript"></script>
  <script src="./js/jquery-ui.custom.min.js" type="text/javascript"></script>
  <script src="./js/jquery.cookie.js" type="text/javascript"></script>

  <link href="./js/skin/ui.dynatree.css" rel="stylesheet" type="text/css" id="skinSheet">
  <link href="./css/style.css" rel="stylesheet" type="text/css" id="skinSheet">

  <!-- data -->
  <script src="./js/data.js" type="text/javascript"></script>

  <!-- selector -->
  <script src="./js/jquery.dynatree.min.js" type="text/javascript"></script>
  <script src="./js/selector.js" type="text/javascript"></script>

  <script>
  function OnSelectDone(items)
  {
        var str = '';
        var comma = '';
        var splitter = ' -> ';
        var row_splitter = '\n';
        // сферы
        for(var i=0; i<items.length; i++)
        {
            // [сфера, специализация, специализация, специализация, ...]
            // специализации
            comma = '';
            for(var i2=0; i2<items[i].length; i2++)
            {
               if (i2 == 1)
                  str += splitter;
               if (i2 > 1)
                  comma = ', ';
               str = str + comma + items[i][i2];
            }
            str = str + row_splitter
        }
        document.getElementById('sfera').value = str;
  }
  </script>

</head>

<body>

    <h1>Selector</h1>
    <p>qwerqwer qwer qwer qwer qwer qwer qwer qwer qwer qwer <br>
    qwer qwer qwer qwer qwer qwer qwer qwer qwer qwer qwer qwe<br>
    qwer qwer qwer qwer qwer qwer qwer qwer qwer qwer qwer qwe<br>
    qwer qwer qwer qwer qwer qwer qwer qwer qwer qwer qwer qwe<br>
    qwer qwer qwer qwer qwer qwer qwer qwer qwer qwer qwer qwe<br>
    qwer qwer qwer qwer qwer qwer qwer qwer qwer qwer qwer qwe<br>
    qwer qwer qwer qwer qwer qwer qwer qwer qwer qwer qwer qwe<br>
    qwer qwer qwer qwer qwer qwer qwer qwer qwer qwer qwer qwe<br>
    qwer qwer qwer qwer qwer qwer qwer qwer qwer qwer qwer qwe<br>
    qwer qwer qwer qwer qwer qwer qwer qwer qwer qwer qwer qwe<br>
    qwer qwer qwer qwer qwer qwer qwer qwer qwer qwer qwer qwe<br>
    qwer qwer qwer qwer qwer qwer qwer qwer qwer qwer qwer qwe<br>
    qwer qwer qwer qwer qwer qwer qwer qwer qwer qwer qwer qwe<br>
    qwer qwer qwer qwer qwer qwer qwer qwer qwer qwer qwer qwe<br>
    qwer qwer qwer qwer qwer qwer qwer qwer qwer qwer qwer qwe<br>
    qwer qwer qwer qwer qwer qwer qwer qwer qwer qwer qwer qwe<br>
    qwer qwer qwer qwer qwer qwer qwer qwer qwer qwer qwer qwe<br>
    qwer qwer qwer qwer qwer qwer qwer qwer qwer qwer qwer qwe<br>
    qwer qwer qwer qwer qwer qwer qwer qwer qwer qwer qwer qwe<br>
    qwer qwer qwer qwer qwer qwer qwer qwer qwer qwer qwer qwe<br>
    qwer qwer qwer qwer qwer qwer qwer qwer qwer qwer qwer qwe<br>
    qwer qwer qwer qwer qwer qwer qwer qwer qwer qwer qwer qwe<br>
    qwer qwer qwer qwer qwer qwer qwer qwer qwer qwer qwer qwe<br>
    qwer qwer qwer qwer qwer qwer qwer qwer qwer qwer qwer qwe<br>
    qwer qwer qwer qwer qwer qwer qwer qwer qwer qwer qwer qwe<br>
    qwer qwer qwer qwer qwer qwer qwer qwer qwer qwer qwer qwe<br>
    qwer qwer qwer qwer qwer qwer qwer qwer qwer qwer qwer qwe<br>
    qwer qwer qwer qwer qwer qwer qwer qwer qwer qwer qwer qwe<br>
    </p>

    <textarea id="sfera" rows="5" cols="80" ></textarea>
    <br>
    <input type="button" value="Select" onclick="Selector(OnSelectDone)">

</body>
</html>
